<template>
	<view class="bangding">
		<view class="bangding-view">
			<image src="../../static/succeed.png"></image>
			<view>绑定成功</view>
		</view>
		
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				url  : '/pages/bangding/bangding',
				shop_id : '',
				staff_id:'',
				type    : 0
			}
		},
		onLoad(e) {
			this.shop_id = e.shop_id;
			this.staff_id = e.staff_id;
			if(e.type){
				this.type = 1;
			}
			if(this.type == 0){
				var bangdingtoken = 'shoptoken'+e.shop_id;
				if(e.user_id){
					
					uni.setStorageSync(bangdingtoken,bangdingtoken)
				}
				if(!uni.getStorageSync(bangdingtoken)){
					var url = "http://hexingv2.kpg888.top/api/index/index?url="+this.url+'&shop_id='+this.shop_id;
					window.location.href=url;
					return;
				}
			}else{
			
				var bangdingtokens = 'stafftoken'+e.staff_id;
					console.log(uni.getStorageSync(bangdingtokens))
				if(e.user_id){
					uni.setStorageSync(bangdingtokens,bangdingtokens)
				}
				if(!uni.getStorageSync(bangdingtokens)){
					var url = "http://hexingv2.kpg888.top/api/index/staff?url="+this.url+'&staff_id='+this.staff_id;
					
					window.location.href=url;
					return;
				}
			}
			console.log(this.type);
			
		},
		methods: {
			
		}
	}
</script>

<style lang="less">
	.bangding-view {
		margin-top: 24%;
		image {
			width: 180rpx;
			height: 180rpx;
			display: block;
			margin: auto;
		}
		view {
			text-align: center;
			padding-top: 16rpx;
			font-size: 36rpx;
		}
	}
</style>
